﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL.Interface.Products;
using DTOS.Products;

namespace BLL.Concrete.Products
{
    class ImagesBAL
    {

        public bool Create(IList<ImagesDTO> objImages)
        {
            bool result = false;
            try
            {
                if (objImages.Count > 0)
                {


                    result = new DBLayer.Products().CreateImageDtls(objImages);

                    if (!result)
                    {
                        throw new Exception("Error while inserting stones");
                    }
                }

                else { throw new Exception("No Images found"); }

                return result;
            }

            catch { throw; }


        }

        public bool Update(ImagesDTO objImages)
        {
            bool result = false;
            try
            {

                result = new DBLayer.Products().UpdateImageDtls(objImages);

                if (!result)
                {
                    throw new Exception("Error while updating product");
                }


                return result;
            }

            catch { throw; }

        }

    }
}
